<?php
namespace Admin\Model;
use Think\Model;
class UserModel extends Model{
    protected $_auto = array (
//         array('password','md5','3','function'),
        array('insert_time','date',1,'function','Y-m-d H:i:s'),
    
    );    
    public function getinfo(){
        $userinfo=$this->create();
        if ($uid=$this->add($userinfo)){
            $data['group_id']=$_POST['group_id'];
            $data['uid']=$uid;
            if(D('Auth_group_access')->add($data)){
                return true;
            }else {
                return false;
            }
           
        }else {
            return false;
        }
    }
    public function editInfo(){
        $userId=I("get.id");
        return $this->find($userId);
    }
    public function updateInfo(){
        $updateinfo=$this->create();       
        if ($this->save($updateinfo)){           
            return true;
        }else {
            return false;
        }
    }
    public function delInfo(){
        $userId=I("get.id");       
        $map['id']=$userId;
        return $this->where($map)->delete();
    }
    

}